<?php

class EventController
{
	/**
	 * Shows a search mask for events
	 */
	public function IndexAction()
	{
		
	}

	/**
	 * POST Action for event-search
	 * 
	 * @param string $keywords Free-text keyword string
	 * @param date $startDate Start of the daterange to search within
	 * @param date $endDate End of the daterange to search within
	 */
	public function FindAction($keywords, $startDate, $endDate)
	{
		
	}
	
	/**
	 * Show a single event
	 * 
	 * @param string $eventId
	 */	
	public function ShowAction($eventId)
	{
		
	}
	
	/**
	 * 
	 * Create an event
	 * @param Event $event
	 * @throws Exception invalid type
	 */
	public function CreateAction($event)
	{
		//ToDo Check, if user role is Admin
		
		if(!($event instanceof Event))
			throw new Exception("Value is not an instance of ".Event::GetType().". Type is ".gettype($event));
	}
	
	/**
	 * 
	 * Edit an Event
	 * @param Event $newEventData
	 * @throws Exception invalid type
	 */
	public function EditEvent($newEventData)
	{
		//ToDo Check if user role is admin
		
		if(!($newEventData instanceof Event))
			throw new Exception("Value is not an instance of ".Event::GetType().". Type is ".gettype($eventData));
	}
	
	/**
	 * 
	 * Delete the evnet
	 * @param string $eventId
	 */
	public function DeleteEvent($eventId)
	{
		//ToDo Check if user role is admin

		
	}
}
?>